package frontera;

/**
 *
 * @author Alexander
 */
public class ObserverFactory {

    private ObserverFactory() {
    }

    public Observer getObserver(int id) {
        if (id == 1) {
            return FramePrincipal.getInstance();
        } else if (id == 2) {
            return PanelHistoriograma.getInstance();
        } else if (id == 3) {
            return panelActual.getInstance();
        } else if (id == 4) {
            return panelReporte.getInstance(); 
        } else if (id == 5) {
            return panelPrediccion.getInstance();
        }
        return null;
    }

    public synchronized static ObserverFactory getInstance() {
        if (m_instance == null) {
            m_instance = new ObserverFactory();
        }

        return m_instance;
    }
    private static ObserverFactory m_instance;
}
